import instance from '../../utils/request';

// export function findAll() {
//     //向后台发送请求，得到数据
//     return instance.get(`/brand/list`);
// }


export function findPage(searchParams) {
    //向后台发送请求，得到数据
    return instance.get(`/brand/findByCriteria`,{params: searchParams});
}

export function brandFindAll() {
    return instance.get(`/brand/list`);
}

export function deleteById(id){
    return instance.delete(`/brand/deleteById/${id}`);
}

export function batchDelete(ids) {
    return instance.delete(`/brand/batchDelete/${ids}`)
}

export function selectById(id) {
    return instance.get(`/brand/findById/${id}`);
}

/**
 * 根据id查询
 */

export function updateById(entity) {
    return instance.put(`/brand/updateBrand/`,entity);
}

export function upload(part) {
    return instance.post(`/common/upload/`, part)
}

/**
 * 添加
 * @param entity
 * @returns {*}
 */
export function insert(entity){
    return instance.post(`/brand/addBrand/`,entity);
}